home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Tools - Objects / Macintosh Programmer’s Workshop / MPW 3.1 / MPW / Interfaces / CIncludes / SCSI.h < prev    next >
Text File  |  1990-12-13  |  4KB  |  107 lines

  1. /************************************************************
  2.  
  3. Created: Thursday, September 7, 1989 at 7:18 PM
  4.     SCSI.h
  5.     C Interface to the Macintosh Libraries
  6.  
  7.  
  8.     Copyright Apple Computer, Inc.    1986-1989
  9.     All rights reserved
  10.  
  11. ************************************************************/
  12.  
  13.  
  14. #ifndef __SCSI__
  15. #define __SCSI__
  16.  
  17. #ifndef __TYPES__
  18. #include <Types.h>
  19. #endif
  20.  
  21. #define scInc 1
  22. #define scNoInc 2
  23. #define scAdd 3
  24. #define scMove 4
  25. #define scLoop 5
  26. #define scNop 6
  27. #define scStop 7
  28. #define scComp 8
  29. #define scCommErr 2                 /*communications error, operation timeout*/
  30. #define scArbNBErr 3                /*arbitration timeout waiting for not BSY*/
  31. #define scBadParmsErr 4             /*bad parameter or TIB opcode*/
  32. #define scPhaseErr 5                /*SCSI bus not in correct phase for attempted operation*/
  33. #define scCompareErr 6                /*data compare error*/
  34. #define scMgrBusyErr 7                /*SCSI Manager busy */
  35. #define scSequenceErr 8             /*attempted operation is out of sequence*/
  36. #define scBusTOErr 9                /*CPU bus timeout*/
  37. #define scComplPhaseErr 10            /*SCSI bus wasn't in Status phase*/
  38. #define sbSIGWord 0x4552
  39. #define pMapSIG 0x504D
  40.  
  41. struct Block0 {
  42.     unsigned short sbSig;            /*unique value for SCSI block 0*/
  43.     unsigned short sbBlkSize;        /*block size of device*/
  44.     unsigned long sbBlkCount;        /*number of blocks on device*/
  45.     unsigned short sbDevType;        /*device type*/
  46.     unsigned short sbDevId;         /*device id*/
  47.     unsigned long sbData;            /*not used*/
  48.     unsigned short sbDrvrCount;     /*driver descriptor count*/
  49.     unsigned long ddBlock;            /*1st driver's starting block*/
  50.     unsigned short ddSize;            /*size of 1st driver (512-byte blks)*/
  51.     unsigned short ddType;            /*system type (1 for Mac+)*/
  52.     unsigned short ddPad[243];        /*ARRAY[0..242] OF INTEGER; not used*/
  53. };
  54.  
  55. typedef struct Block0 Block0;
  56. struct Partition {
  57.     unsigned short pmSig;            /*unique value for map entry blk*/
  58.     unsigned short pmSigPad;        /*currently unused*/
  59.     unsigned long pmMapBlkCnt;        /*# of blks in partition map*/
  60.     unsigned long pmPyPartStart;    /*physical start blk of partition*/
  61.     unsigned long pmPartBlkCnt;     /*# of blks in this partition*/
  62.     unsigned char pmPartName[32];    /*ASCII partition name*/
  63.     unsigned char pmParType[32];    /*ASCII partition type*/
  64.     unsigned long pmLgDataStart;    /*log. # of partition's 1st data blk*/
  65.     unsigned long pmDataCnt;        /*# of blks in partition's data area*/
  66.     unsigned long pmPartStatus;     /*bit field for partition status*/
  67.     unsigned long pmLgBootStart;    /*log. blk of partition's boot code*/
  68.     unsigned long pmBootSize;        /*number of bytes in boot code*/
  69.     unsigned long pmBootAddr;        /*memory load address of boot code*/
  70.     unsigned long pmBootAddr2;        /*currently unused*/
  71.     unsigned long pmBootEntry;        /*entry point of boot code*/
  72.     unsigned long pmBootEntry2;     /*currently unused*/
  73.     unsigned long pmBootCksum;        /*checksum of boot code*/
  74.     unsigned char pmProcessor[16];    /*ASCII for the processor type*/
  75.     unsigned short pmPad[188];        /*512 bytes long currently unused*/
  76. };
  77.  
  78. typedef struct Partition Partition;
  79. struct SCSIInstr {
  80.     unsigned short scOpcode;
  81.     unsigned long scParam1;
  82.     unsigned long scParam2;
  83. };
  84.  
  85. typedef struct SCSIInstr SCSIInstr;
  86. #ifdef __cplusplus
  87. extern "C" {
  88. #endif
  89. pascal OSErr SCSIReset(void);
  90. pascal OSErr SCSIGet(void); 
  91. pascal OSErr SCSISelect(short targetID);
  92. pascal OSErr SCSICmd(Ptr buffer,short count);
  93. pascal OSErr SCSIRead(Ptr tibPtr);
  94. pascal OSErr SCSIRBlind(Ptr tibPtr);
  95. pascal OSErr SCSIWrite(Ptr tibPtr); 
  96. pascal OSErr SCSIWBlind(Ptr tibPtr);
  97. pascal OSErr SCSIComplete(short *stat,short *message,unsigned long wait);
  98. pascal short SCSIStat(void);
  99. pascal OSErr SCSISelAtn(short targetID);
  100. pascal OSErr SCSIMsgIn(short *message); 
  101. pascal OSErr SCSIMsgOut(short message); 
  102. #ifdef __cplusplus
  103. }
  104. #endif
  105.  
  106. #endif
  107.